import request from '@/config/axios'

// AI 聊天角色 API
export const ChatRoleApi = {
  // 查询聊天角色分页
  getChatRolePage: async (params) => {
    return await request.get({ url: `/ai/chat-role/page`, params })
  },

  // 查询聊天角色详情
  getChatRole: async (id) => {
    return await request.get({ url: `/ai/chat-role/get?id=` + id })
  },

  // 新增聊天角色
  createChatRole: async (data) => {
    return await request.post({ url: `/ai/chat-role/create`, data })
  },

  // 修改聊天角色
  updateChatRole: async (data) => {
    return await request.put({ url: `/ai/chat-role/update`, data })
  },

  // 删除聊天角色
  deleteChatRole: async (id) => {
    return await request.delete({ url: `/ai/chat-role/delete?id=` + id })
  },

  // ======= chat 聊天

  // 获取 my role
  getMyPage: async (params) => {
    return await request.get({ url: `/ai/chat-role/my-page`, params})
  },

  // 获取角色分类
  getCategoryList: async () => {
    return await request.get({ url: `/ai/chat-role/category-list`})
  },

  // 创建角色
  createMy: async (data) => {
    return await request.post({ url: `/ai/chat-role/create-my`, data})
  },

  // 更新角色
  updateMy: async (data) => {
    return await request.put({ url: `/ai/chat-role/update-my`, data})
  },

  // 删除角色 my
  deleteMy: async (id) => {
    return await request.delete({ url: `/ai/chat-role/delete-my?id=` + id })
  },
}
